package com.tian.sakura.cdd.db.dao.activity;

import com.tian.sakura.cdd.common.entity.AbstractSingleMapper;
import com.tian.sakura.cdd.common.req.activity.AdminActivityReq;
import com.tian.sakura.cdd.common.resp.activity.AdminActivityProductResp;
import com.tian.sakura.cdd.db.domain.activity.ActivityProduct;
import com.tian.sakura.cdd.db.manage.activity.vo.ActivityProductQueryVo;
import com.tian.sakura.cdd.db.manage.activity.vo.ActivityProductVo;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ActivityProductMapper extends AbstractSingleMapper<ActivityProduct, String> {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    int insert(ActivityProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    int insertSelective(ActivityProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    ActivityProduct selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(ActivityProduct record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table s_activity_product
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(ActivityProduct record);

    List<AdminActivityProductResp> listActivityProduct(AdminActivityReq activityReq);

    //根据活动id获取商品
    List<ActivityProductVo> getProductsByActivityId(ActivityProductQueryVo queryVo);

    int selectByActIdAndProductId(@Param("actId") String actId, @Param("id") String id);
}